package com.itheima.Homework5;

public class Test07 {
    public static void main(String[] args) {
        //调用方法
        int a = method(3.89);
        System.out.println(a);
    }

    public static int method(double i) {
        //取整数部分
        int a = (int) i;
        //取小数部分
        double b = i - a;
        //做出判断
        if (b < 0.5) {
            return a;
        } else {
            return a + 1;
        }
    }
}
